﻿namespace PillBox.Client.ViewModels
{
    using System.Collections.Generic;
    using System.Linq;
    using PillBox.Client.Model;

    public static class ViewModelExtensions
    {
        public static IEnumerable<PersonChoiceViewModel> AsPersonChoice(this IEnumerable<Person> people)
        {
            return from p in people
                   select new PersonChoiceViewModel { Person = p };
        }

        public static IEnumerable<MedicationChoiceViewModel> AsMedicationChoice(this IEnumerable<Medication> medications)
        {
            return from m in medications
                   select new MedicationChoiceViewModel { Medication = m };
        }
    }
}
